﻿using System.Configuration;

namespace Core
{
    public static class AppSettings
    {

        /// <summary>
        /// Database connection string
        /// </summary>
        public static string ConnectionString
        {
            get
            {
                return GetValue("RepositoryConnectionName");
            }
        }

        public static string MongodbName
        {
            get { return GetValue("MongoDBName"); }
        }

        public static string GetValue(string key)
        {
            var value = ConfigurationManager.AppSettings[key];

            if (string.IsNullOrEmpty(value))
            {
                return string.Empty;
            }

            return value;
        }

        public static void SetValue(string key, string value)
        {
            ConfigurationManager.AppSettings[key] = value;
        }
    }
}